package com.lbd.suggestion.controller;

import com.lbd.base.controller.BaseController;
import com.lbd.commons.Result;
import com.lbd.commons.ResultState;
import com.lbd.suggestion.bean.Suggestion;
import com.lbd.suggestion.controller.vo.SuggestionVo;
import com.lbd.suggestion.service.SuggestionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by Yuanbo on 2016/9/26.
 * 投诉建议
 */
@RestController
@RequestMapping("/suggestion")
public class SuggestionController extends BaseController {

    @Autowired
    SuggestionService suggestionService;

    /**
     * 查看投诉建议
     *
     * @param page         当前页码
     * @param rows         每页显示条数
     * @param suggestionVo 投诉建议实体类
     * @return 投诉建议集
     */
    @RequestMapping(value = "/list", method = RequestMethod.GET)
    public Result list(int page, int rows, SuggestionVo suggestionVo) {
        return new Result(ResultState.SUCCESS, "查看投诉建议成功", suggestionService.findByPageConditionJpql(page, rows, suggestionVo));
    }

}
